package org.liveboardgames.agricola.control.delegates.mock.cards.actioncards
{
	import org.liveboardgames.agricola.control.delegates.mock.ActionFactory;
	import org.liveboardgames.agricola.model.enums.ActionOutputEnum;
	import org.liveboardgames.agricola.model.enums.ResourceZoneEnum;
	import org.liveboardgames.agricola.view.component.ImageHandler;
	import org.liveboardgames.agricola.vo.action.Action;
	import org.liveboardgames.agricola.vo.card.ActionCard;
	
	import mx.collections.ArrayCollection;
	import mx.collections.ListCollectionView;

	public class PeriodThreeCards
	{
		public static const ONE_BOAR:ActionCard = getOneBoarCard();
		public static const ONE_VEGETABLE:ActionCard = getOneVegCard();

		private static function getOneBoarCard():ActionCard
		{
			var card:ActionCard = new ActionCard();
			card.imagePath = ImageHandler.ACTIONS + "OneBoar.png";
			card.resourceZone = ResourceZoneEnum.BOTTOM;

			// Build the actions
			var actions:ListCollectionView = new ArrayCollection();
			var action:Action = ActionFactory.getResourceAction(ActionOutputEnum.BOAR, 1, true);
			action.target = card;
			action.needPlayerInput = false;
			actions.addItem(action);

			// A peep can take all accumulated animals
			var takeAction:Action = ActionFactory.getTakeAnimalAction(card);
			actions.addItem(takeAction);

			card.actions = actions;
			return card;
		}

		private static function getOneVegCard():ActionCard
		{
			var card:ActionCard = new ActionCard();
			card.imagePath = ImageHandler.ACTIONS + "OneVegetable.png";

			// Build the actions
			var actions:ListCollectionView = new ArrayCollection();
			var action:Action = ActionFactory.getResourceAction(ActionOutputEnum.VEGETABLE, 1, false);
			action.needPlayerInput = false;

			actions.addItem(action);

			card.actions = actions;
			return card;
		}
	}
}